# -*- coding: utf-8 -*-
"""
URLs of ``blog`` application.
"""
from apps.blog.feeds import RssEntries, RssCategory
from PyBlog.apps.blog.views import *
from django.conf.urls.defaults import url, patterns
from django.core.urlresolvers import reverse


rss_feeds = {
    'entries': RssEntries,
    'category': RssCategory,
}

urlpatterns = patterns('',
    url(r'^category/(?P<slug>[\w-]+)/$', CategoryDetail.as_view(), name = 'Category_Detail'),
    url(r'^tag/(?P<tag>[\w-]+)/$', 'apps.blog.views.tag_list'),
    url(r'^author/(?P<author>[\w-]+)/$', 'apps.blog.views.author_list', name='author_list'),
    url(r'^$', Index.as_view(), name='index'),
    url(r'^archive/$', Archive.as_view()),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[\w-]+)/$',EntryDetail.as_view(),name='Entry_Detail'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$',BlogDay.as_view()),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/$',BlogMonth.as_view()),
    url(r'^(?P<year>\d{4})/$',BlogYear.as_view()),
    
    url(r'^feed/rss/(?P<url>.*)/$',
        'django.contrib.syndication.views.feed', {
            'feed_dict': rss_feeds,
        },
        name='blog_rss_feed',
    ),
                       
    
)

